feat(toml): allow overriding inherited default-features in 2024 - #17126
Conversation
72f4119 to
62db596
Compare
|
Will we need to update https://doc.rust-lang.org/edition-guide/rust-2024/cargo-inherited-default-features.html as part of this? |
f2f677f to
17595ac
Compare
Yes, I will create a PR for this. |
33ca750 to
1b14f50
Compare
There was a problem hiding this comment.
🔢 Self-check (PR reviewed by myself and ready for feedback)
-
Code compiles successfully
-
Unit tests added
-
No AI-generated elegant nonsense in PR.
-
Comments added where necessary
-
PR title and description updated
-
Documentation updated
-
PR size is reasonable
| - [`default-features`][default-features] (Edition 2024 packages, requires Rust 1.98+): | ||
| Overrides the value set in `[workspace.dependencies]`. | ||
| If neither the package nor the workspace specifies `default-features`, it defaults to `true`. | ||
| Before Rust 1.98, or in earlier editions, package-level `default-features = false` |
There was a problem hiding this comment.
Not sure if this is the perfect word for it, and not sure how detailed we should be here.
e97fffa to
62a3dd8
Compare
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
|
Looks like some tests need updating |
Impl RFC 3945, on Edition 2024+ allow workspace members to override the workspace dependency's `default-features` setting. Earlier editions are unchanged: setting `default-features` on an inherited dependency is still ignored with a warning. Signed-off-by: 0xPoe <techregister@pm.me>
Signed-off-by: 0xPoe <techregister@pm.me>
`cargo add --no-default-features` (or `--default-features`) against a dependency inherited from `[workspace.dependencies]` is now allowed when the package is on Edition 2024+, matching the manifest behavior. Earlier editions still error, pointing the user to the workspace manifest. Signed-off-by: 0xPoe <techregister@pm.me>
Signed-off-by: 0xPoe <techregister@pm.me>
Signed-off-by: 0xPoe <techregister@pm.me>
Signed-off-by: 0xPoe <techregister@pm.me>
Signed-off-by: 0xPoe <techregister@pm.me>
677fb45 to
945b29c
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Updated. See changes at: #17126 (comment) |
|
Thanks for your review! 💚 💙 💜 💛 ❤️ |
I will handle this tomorrow. |
Update cargo submodule 14 commits in c79e8f89441b3e73d6d65d125c0c745792808c74..b07e5a08651da80108eb65d7dc769ee04589f9bf 2026-08-04 19:17:33 +0000 to 2026-08-07 21:51:16 +0000 - feat(profile): Add built-in profile debug (rust-lang/cargo#17214) - feat(toml): allow overriding inherited default-features in 2024 (rust-lang/cargo#17126) - feat(resolver): Report the min-publish-age in the lock message (rust-lang/cargo#17328) - refactor(resolver): resolve() does not need an optional gctx (rust-lang/cargo#17331) - fix(resolver): Make min-publish-age relative to --publish-time (rust-lang/cargo#17327) - test(trim-paths): exercise unremap files with debuggers (rust-lang/cargo#17326) - feat(log): emit build-started JSON message with run_id (rust-lang/cargo#16632) - docs: remove stray `directory` metavar from `cargo update --breaking` option (rust-lang/cargo#17319) - fix(lock): Use more accurate 'highest, rather than 'latest' (rust-lang/cargo#17317) - docs(changelog): Pull the --verbose item (rust-lang/cargo#17315) - revert(compiler): forward verbose flag to rustc for local crates (rust-lang/cargo#17314) - fix(diag): Gate blanket_hint_mostly_unused with -Zprofile-hint-mostly-unused (rust-lang/cargo#17313) - fix(diag): Remove complexity, perf, and nursery lint groups (rust-lang/cargo#17307) - fix(git): Avoid use of git's core.fsmonitor (rust-lang/cargo#17306) r? ghost
View all comments
What does this PR try to resolve?
close #16959
Implement RFC 3945, on Edition 2024+ allow workspace members to override the workspace dependency's
default-featuressetting.Earlier editions are unchanged: setting
default-featureson an inherited dependency is still ignored with a warning.Also, this change would allow
cargo add X --no-default-features -p Y, but only on Edition 2024+.How to test and review this PR?
Review and check it commit by commit.
r?@ghost